#ifndef INC_INCGENSUP_COMMAND_NODE_NODECOMMAND_H
#define INC_INCGENSUP_COMMAND_NODE_NODECOMMAND_H

#include "node/node.h"
#include "command/command.h"
using Commands::Command;

namespace Commands {
	/**
	 * Basetype for Node-level commands
	 */
	class NodeCommand : public Command
	{
		id_type _nodeID;
		id_type _prevID;
		id_type _nextID;
		string _ringname;
		SocketAddress _remote;
		SocketAddress _local;
		Master* _master;
		UInt16 _port;
		Node* _node;

		public:
			NodeCommand(NodeData* data = 0, bool need_result = false);
			virtual ~NodeCommand() {}

		protected:
			virtual Document* toXML(Document * doc = 0);

			string ringname() const { return _ringname; }
			id_type nodeId() const { return _nodeID; }
			id_type prevId() const { return _prevID; }
			id_type nextId() const { return _nextID; }
			SocketAddress remote() const { return _remote; }
			SocketAddress local() const { return _local; }
			Master* master() const { return _master; }
			UInt16 slavePort() const { return _port; }
			Node* node() const { return _node; }
	};
}
#endif /* INC_INCGENSUP_COMMAND_NODE_NODECOMMAND_H */
